import React from 'react';
import useCounter from '@/hooks/useCounter.tsx'
import {Button} from "antd";
import {string} from "prop-types";
import './index.scss'

CommonTest.propTypes = {
    title: string
};

function CommonTest(props) {
    const {count, increment, decrement, reset} = useCounter();
    const {title} = props;
    return (
        <div className='rt-commonTest flex justify-center items-center dark:bg-rose-900'>
            <div className='flex gap-3 items-center'>
                <p>{title}</p>
                <Button type='primary' onClick={decrement}> - </Button>
                <p>{count}</p>
                <Button type='dashed' onClick={increment}> + </Button>
                <Button danger onClick={reset}> reset </Button>
            </div>
        </div>
    );
}

export default CommonTest;